package com.onlinevideo.service.impl;

import com.onlinevideo.dao.FavoritesDao;
import com.onlinevideo.dao.impl.FavoritesDaoImpl;
import com.onlinevideo.entity.Favorites;
import com.onlinevideo.service.FavoritesService;

import java.util.List;

public class FavoritesServiceImpl implements FavoritesService {

    private FavoritesDao favoritesDao = new FavoritesDaoImpl();

    @Override
    public int insert(Favorites favorites) {
        return favoritesDao.insert(favorites);
    }

    @Override
    public int delete(Long id) {
        return favoritesDao.delete(id);
    }

    @Override
    public int update(Favorites favorites) {
        return favoritesDao.update(favorites);
    }

    @Override
    public Favorites queryById(Long id) {
        return favoritesDao.queryById(id);
    }

    @Override
    public Favorites queryByFavoriteName(Favorites favorites) {
        return favoritesDao.queryByFavoriteName(favorites);
    }

    @Override
    public Long queryByFavoriteCount(Long userId) {
        return favoritesDao.queryByFavoriteCount(userId);
    }

    @Override
    public List<Favorites> queryAll() {
        return favoritesDao.queryAll();
    }

    @Override
    public List<Favorites> queryByUser(Long userId) {
        return favoritesDao.queryUser(userId);
    }
}
